<?php

/**
 * This is the model metadata class for table "company_hotel_album".
 */
class CompanyHotelAlbumMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'company_hotel_album';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('name, path', 'required'),
			array('parent_id, layer, object_id, class_id', 'numerical', 'integerOnly'=>true),
			array('name', 'length', 'max'=>20),
			array('desc', 'length', 'max'=>100),
			array('path', 'length', 'max'=>255),
			array('create_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, parent_id, name, desc, path, layer, object_id, class_id, create_time', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'parent_id' => 'Parent',
			'name' => '名称',
			'desc' => '描述',
			'path' => '图片',
			'layer' => 'Layer',
			'object_id' => 'Object',
			'class_id' => 'Class',
			'create_time' => '创建时间',
		);
	}
}